<?php

	eb_include_class("EbTableSQLModel");

	class RoleModel extends EbTableSQLModel
	{
		public function __construct()
		{
			parent::init('eb_role','Core/RoleVO','ro_id');
		}
		
		public function getColumns()
		{
			return array(
				new EbTableColumn("ro_id","int",true,EB_PRIMARY_KEY,true),
				new EbTableColumn("name","varchar(32)",true,EB_UNIQUE_KEY)
			);
		}		
		
		public function create()
		{
			if (parent::create())
			{
				$this->insert(array("name" => "guest"));
				$this->insert(array("name" => "admin"));
	
				return true;
			}	
			else
			{
				return false;
			}
		}
	}